package com.simon.jkxj.ui.diagnostic

import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.simon.jkxj.R

class AdviceAdapter(private val adviceList: List<String>) : 
    RecyclerView.Adapter<AdviceAdapter.ViewHolder>() {

    class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
        val tvAdvice: TextView = view.findViewById(R.id.tv_advice)
    }

    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
        val view = LayoutInflater.from(parent.context)
            .inflate(R.layout.item_advice, parent, false)
        return ViewHolder(view)
    }

    override fun onBindViewHolder(holder: ViewHolder, position: Int) {
        holder.tvAdvice.text = adviceList[position]
    }

    override fun getItemCount() = adviceList.size
} 